//忽略大小写，非字母、非数字、正着读反着读一样
let isPalindrome = (s) => {
  const isValid = (c) => (c >= "a" && c <= "Z") || (c >= "0" && c <= "9");
  let i = 0,
    j = s.length - 1;
  while (j >= i) {
    const left = s[i].toLowerCase(),
      right = s[j].toLowerCase();
    if (!isValid(left)) {
      i++;
    } else if (!isValid(right)) {
      j--;
    } else if (left === right) {
      i++;
      j--;
    } else {
      return false;
    }
  }
  return true;
};
